{% extends 'blog/base.html' %}
{% load static %}
{% block title %}{{ entry.title }}--博客正文页面{% endblock %}
{% block css %}
    <link rel="stylesheet" href="{% static 'blog/css/styles.css' %}">
{% endblock %}
{% block main %}
    <div class="main container">
        <div class="row">
            <div class="col-sm-9">
                <h1>{{ entry.title }}</h1>
                <p>
                    <span>作者：{{ entry.author }}</span>
                    <span>发布于：{{ entry.created_time }}</span>
                    <span>访问量：{{ entry.visited }}</span>
                    <span>分类：
                        {% for category in entry.category.all %}
                            <a href="{% url 'blog:blog_category' category.id %}">{{ category.name }}</a>
                        {% endfor %}
                    </span>
                    <span>标签：
                        {% for tag in entry.tag.all %}
                            <a href="{% url 'blog:blog_tag' tag.id %}">{{ tag.name }}</a>
                        {% endfor %}
                    </span>
                </p>
                {% if entry.img %}
                    <div><img src="{{ entry.img.url }}" alt="博客配图" class="blog-img"></div>
                {% endif %}
                <div>{{ entry.toc|safe }}</div>
                <div>{{ entry.body|safe }}</div>
            </div>
        </div>
    </div>
{% endblock %}